package com.youbug.system.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.youbug.common.vo.QueryVo;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.Date;

@Data
public class SysLog {
    @Id
    private String id;

    @Field(type = FieldType.Keyword)
    private String level;

    @Field(type = FieldType.Text)
    private String client;

    @Field(type = FieldType.Text)
    private String msg;

    @Field(type = FieldType.Text)
    private String thread;

    @Field(type = FieldType.Text)
    private String logger;

    @Field(type = FieldType.Text)
    private String trace;

    @Field(name = "@timestamp", type = FieldType.Date, format = DateFormat.date_time)
    private Date timestamp;
    @NotNull(message = "开始时间不能为空")
    private Date startTime;
    @NotNull(message = "结束时间不能为空")
    private Date endTime;

}
